#ifndef __MOTORDEV_H_
#define __MOTORDEV_H_

#include "Global.h"

enum
{
    _Motor_F=0, //��ת
    _Motor_R,   //��ת  

};

enum
{
    _Motor_Idle=0,
    _Motor_Work,
};

extern bit F_STATE_VALVE;
extern uint8 F_VALVE_DIR;

#define MOTOR_FORWARD()  do{_pxc = 0b00000110;/*_hvbden = 0;_hvdoen = 1;*/}while(0)
#define MOTOR_BACKWARD() do{_pxc = 0b00001001;/*_hvbden = 0;_hvdoen = 1;*/}while(0)
// #define MOTOR_STOP()     do{_pxc = 0b00000000;_hvbden = 1;_hvdoen = 0;}while(0)
#define MOTOR_STOP()     do{_pxc = 0b00000101;/*_hvbden = 0;_hvdoen = 0;*/}while(0)

void MotorDev_HardwareConfig(void);
void MotorDev_SetType(uint8 type);
void MotorDev_SetWorkSta(uint8 work_sta);

void OpenValve(void);
void CloseValve(void);

#endif




